package com.yfqy.admin.enums;

import com.yfqy.admin.constant.MyConstants;
import lombok.Getter;

@Getter
public enum MenuTypeEnum {
    directory(MyConstants.BT1, "目录"),

    menu(MyConstants.BT2, "菜单"),

    button(MyConstants.BT3, "按钮"),
    ;

    /**
     * 1-目录，2-菜单，3-按钮
     */
    private final Byte menuType;

    private final String menuName;

    MenuTypeEnum(Byte menuType, String menuName) {
        this.menuType = menuType;
        this.menuName = menuName;
    }

    public static MenuTypeEnum getByType(byte menuType) {
        for (MenuTypeEnum menu : values()) {
            if (menu.menuType == menuType) {
                return menu;
            }
        }
        return null;
    }
}
